package com.xc.service;

import com.xc.common.ServerResponse;
import com.xc.pojo.User;
import javax.servlet.http.HttpServletRequest;
import java.math.BigDecimal;

/**
 * @author mipha
 * @version 1.0
 * @date 2019/2/15 3:42 PM
 */
public interface IUserService {


    ServerResponse reg(String yzmCode , String agentCode
            , String phone , String userPwd , HttpServletRequest request);

    ServerResponse login(String phone,String userPwd,HttpServletRequest request);

    User getCurrentUser(HttpServletRequest request);
    User getCurrentRefreshUser(HttpServletRequest request);

    ServerResponse addOption(String code , HttpServletRequest request);
    ServerResponse delOption(String code, HttpServletRequest request);
    ServerResponse isOption(String code, HttpServletRequest request);

    ServerResponse getUserInfo(HttpServletRequest request);

    ServerResponse updatePwd(String oldPwd,String newPwd,HttpServletRequest request);

    ServerResponse checkPhone(String phone);

    ServerResponse updatePwd(String phone,String code,String newPwd);

    ServerResponse update(User user);

    ServerResponse auth(String realName,String idCard
            ,String img1key,String img2key,String img3key
                        ,HttpServletRequest request);

    /**
     *  查询用户所有的持仓单，强制平仓任务
     */
    void ForceSellTask();




    //  代理后台
    ServerResponse listByAgent(String realName,String phone,Integer agentId
            ,Integer accountType,int pageNum,int pageSize,HttpServletRequest request);
    ServerResponse addSimulatedAccount(Integer agentId,String phone,String pwd,String amt,HttpServletRequest request);


    //  总后台
    ServerResponse listByAdmin(String realName,String phone,Integer agentId
            ,Integer accountType,int pageNum,int pageSize,HttpServletRequest request);
    ServerResponse findByUserId(Integer userId);
    ServerResponse updateLock(Integer userId);
    ServerResponse updateAmt(Integer userId,Integer amt,Integer direction);

    int CountUserSize(Integer accountType);

    BigDecimal CountUserAmt(Integer accountType);
    BigDecimal CountEnableAmt(Integer accountType);

    ServerResponse authByAdmin(Integer userId,Integer state,String authMsg);


}
